<style type="text/css">
    .headnav :hover{
        background: #ff3c3c !important;
        border: none !important;
        color: #fff !important;
    }
    .headnav_active{
        /* background: #ff3c3c !important;
        padding-top:10px;
        padding-bottom:10px;
        border: none !important; */
        color: #ff3c3c !important;
    }
    .layui-laypage .layui-laypage-curr .layui-laypage-em{background: none;}
    .layui-laypage a, .layui-laypage span{height:40px;}
</style>
<script>
$(function(){
    <?php if(!($c=='index'&&$a='init')):?>
    //全部分类显示与隐藏
    var pd=null;
    $('#AllGoodsMenu').hover(function(){
            window.clearInterval(pd);
            $('#GoodsMenuDiv').slideDown(500).hover(function(){
                    window.clearInterval(pd);
                    $(this).show();
            },function(){
                    $(this).hide();
            });
    },function(){
            slideUp();
    });
    function slideUp(){
            pd=setInterval(function(){
                    $('#GoodsMenuDiv').slideUp(500);
            },500);
    }
    <?php endif;?>
});
</script>
<!--公共导航条-->
<div class='public-top bor_bom'>
<!--w1200-->
<div class='top-wrap w1200'>
<!--用户登录注册-->
  <div class='top-user fl'>
  <ul><a href='/user/center'><li>您好：<?=isset($userinfo['username'])?$userinfo['username']:'游客';?></li></a>
	<?php if(!$userinfo):?>
        <a href='/publics/login'><li>登录</li></a>
    	<a href='/publics/register'><li>注册</li></a>
    <?php endif;?>
	<?php if($userinfo):?>
		<a href='/publics/logout'><li>退出</li></a>
	<?php endif;?>
</ul>
</div>
<!--商户代理商家-->
<div class='top-menu fr'>
  <ul>
	<a href='/article/detail?id=28'><li>商家入驻<i class='car'></i></li></a>
	<a href='/user/myCart'><li>购物车<i class='car'></i></li></a>
	<a href='/article/detail?id=15'><li>用户须知<i class='car'></i></li></a>
	<a href='/article/detail?id=6'><li>帮助中心</li></a>
  </ul>
</div>
<!--商户代理商家-->
<div class='clear'></div>
</div>
<!--w1200-->
</div>
<!--公共导航条-->
<!--页面头部-->
<div class='main-header'>
    <!--w1200-->
    <div class='header-wrap w1200'>
        <!--logo-->
        <div class='main-logo fl'><a href='/'><img src='<?=$com["img"]["left_top_logo"]["pic"]?>'></a></div>
        <!--logo-->
        <!--搜索框-->
        <div class='main-search fl'>
            <div class='search-bar'>
                <form class='layui-form' action='/goods/lists' method='get'>
                    <input name='keyword' type='text' placeholder='请输入商品关键字' id='search-box' value='<?=isset($keyword)?$keyword:'';?>'>
                    <input type='submit' value='搜索' lay-submit lay-filter="formDemo" id='search-btn'>
                </form>
                <script>
                layui.use('form', function(){
                      var form = layui.form;
                      //监听提交
                      form.on('submit(formDemo)', function(data){
                          var o = GetRequest();
                          o.url  = '/goods/lists';
                          o.keyword = data.field.keyword;
                          window.location.href = createUrl(o);
                          return false;
                      });
                    });
                </script>
            </div>
            <!--搜索关键字-->
            <div class='search-keywrod'><span class='title'>热门搜索：</span>
                <ul class='keywrod-wrap'>
                    <?php foreach($sys['hot_search_keyword'] as $v):?>
                        <a href='/goods/lists?keyword=<?=$v?>'><li><?=$v?></li></a>
                    <?php endforeach;?>
                </ul>
            </div>
            <!--搜索关键字-->
        </div>
        <!--搜索框-->
        <!--购物车-->
        <div class='buy_car fr'>
            <a href='/user/myCart' title='我的购物车' class='carbar'>
                <i></i>
                购物车(<span id='buyCarMenu'><?=$cart_count?></span>)
            </a>
        </div>
        <!--购物车-->
        <div class='clear'></div>
    </div>
    <!--w1200-->
</div>
<!--页面头部-->
<div class='main_nav'>
    <div class='w1200' style='position: relative;'>
        <a href='javascritp:;' class='nav_title' id='AllGoodsMenu'><i class='ico'></i>全部分类</a>

        <div class='main_menu fl import_menu' id='GoodsMenuDiv' style='display:none'>
            <div class='main_menu_bg'></div>
            <ul class='meun_wrap'>
                <?php foreach($goodscat as $k1 => $v1):?>
                <?php if($v1['parent_id']==0 && $k1 < 8):?>

                <li>
                    <dl class='parent_title'>
                        <dt>
                            <i class='iconfont <?=$v1["icon"]?>'></i>
                            <a href='/goods/lists?cat_id=<?=$v1["id"]?>'><?=$v1['cat_title']?></a>
                            <b class='icon'>></b>
                        </dt>
                        <dd><?=$v1['sub_title']?></dd>
                    </dl>
                    <div class='child_node'>
                        <?php
                        foreach($goodscat as $v2):
                            if($v2['parent_id']==$v1['id']):
                        ?>
                            <dl class='child_dl'>
                                <dt><a href='/goods/lists?cat_id=<?=$v2["id"]?>'><?=$v2['cat_title']?></a></dt>
                                <dd>
                                    <?php
                                    foreach($goodscat as $v3):
                                        if($v3['parent_id']==$v2['id']):
                                    ?>
                                    <a href='/goods/lists?cat_id=<?=$v3["id"]?>'><?=$v3['cat_title']?></a>
                                    <?php endif;endforeach;?>
                                </dd>
                            </dl>
                        <?php endif;endforeach;?>
                    </div>
                </li>
                <?php endif;?>
                <?php endforeach;?>
            </ul>
        </div>

        <!--热搜关键词-->
        <ul class='search_key'>
            <?php
            $nav_cat = $this->get('cat_id');
            $str = '/goods/lists?cat_id='.$nav_cat;
            $headnav = $navs['2'];
            foreach($headnav as $k => $v):?>
            <a class="headnav <?php if($v['url'] == $str):?>headnav_active<?php endif;?>" <?php if($v['link_type']==1):?>target="_blank"<?php endif;?> href="<?=$v['url']?>"><li><?=$v['title']?></li></a>
            <?php endforeach;?>

        </ul>
        <div class='animate_pic fr'><img src='<?=$com["img"]["right_top_logo"]["pic"]?>'></div>
        <div class='clear'></div>
    </div>
</div>
